package org.apache.rocketmq.proxy.grpc.interceptor;

import io.grpc.Context;
import io.grpc.Metadata;


/**
 * @课程描述:从零带你写框架系列中的课程，整个系列包含netty，xxl-job，rocketmq，nacos，sofajraft，spring，springboot，disruptor，编译器，虚拟机等等。
 * @author：陈清风扬，个人微信号：chenqingfengyangjj。
 * @date:2025/1/3
 * @方法描述：拦截器常量类，这个类中的各个成员变量代表的是元数据信息的键
 */
public class InterceptorConstants {
    public static final Context.Key<Metadata> METADATA = Context.key("rpc-metadata");

    /**
     * Remote address key in attributes of call
     */
    public static final Metadata.Key<String> REMOTE_ADDRESS
            = Metadata.Key.of("rpc-remote-address", Metadata.ASCII_STRING_MARSHALLER);

    /**
     * Local address key in attributes of call
     */
    public static final Metadata.Key<String> LOCAL_ADDRESS
            = Metadata.Key.of("rpc-local-address", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> AUTHORIZATION
            = Metadata.Key.of("authorization", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> NAMESPACE_ID
            = Metadata.Key.of("x-mq-namespace", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> DATE_TIME
            = Metadata.Key.of("x-mq-date-time", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> REQUEST_ID
            = Metadata.Key.of("x-mq-request-id", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> LANGUAGE
            = Metadata.Key.of("x-mq-language", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> CLIENT_VERSION
            = Metadata.Key.of("x-mq-client-version", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> PROTOCOL_VERSION
            = Metadata.Key.of("x-mq-protocol", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> RPC_NAME
            = Metadata.Key.of("x-mq-rpc-name", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> SIMPLE_RPC_NAME
            = Metadata.Key.of("x-mq-simple-rpc-name", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> SESSION_TOKEN
            = Metadata.Key.of("x-mq-session-token", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> CLIENT_ID
            = Metadata.Key.of("x-mq-client-id", Metadata.ASCII_STRING_MARSHALLER);

    public static final Metadata.Key<String> AUTHORIZATION_AK
            = Metadata.Key.of("x-mq-authorization-ak", Metadata.ASCII_STRING_MARSHALLER);
}

